Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
@commitlint/read
Advanced tools
@commitlint/read is an npm package that provides functionality to read and parse commit messages. It is typically used in conjunction with commitlint to enforce commit message conventions.
Read commit messages from a file
This feature allows you to read commit messages from a specified range of commits. In this example, it reads the commit message from the last commit.
const read = require('@commitlint/read');
read({from: 'HEAD~1', to: 'HEAD'}).then((messages) => {
console.log(messages);
});
Read commit messages from stdin
This feature allows you to read commit messages from the standard input. This is useful for integrating with other tools that provide commit messages via stdin.
const read = require('@commitlint/read');
process.stdin.on('data', (data) => {
read({edit: true}).then((messages) => {
console.log(messages);
});
});
conventional-changelog is a package that reads commit messages and generates changelogs based on conventional commit messages. It provides more extensive functionality for generating changelogs and release notes compared to @commitlint/read.
git-raw-commits is a package that reads raw commit messages from a git repository. It is similar to @commitlint/read in that it focuses on reading commit messages, but it provides more low-level access to the raw commit data.
Read commit messages from a specified range or last edit
npm install --save @commitlint/read
const read = require('@commitlint/read').default;
// Read last edited commit message
read({edit: true}).then((messages) => console.log(messages));
// => ['I did something\n\n']
// Read from the third to second commit message from HEAD
read({from: 'HEAD~2', to: 'HEAD~1'}).then((messages) => console.log(messages));
// => ['Initial commit\n\n']
Consult docs/api for comprehensive documentation.
17.8.1 (2023-10-20)
Note: Version bump only for package @commitlint/root
FAQs
Read commit messages from a specified range or last edit
The npm package @commitlint/read receives a total of 2,626,345 weekly downloads. As such, @commitlint/read popularity was classified as popular.
We found that @commitlint/read demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.